package com.isesol.controller;

import com.isesol.service.*;
import org.slf4j.*;
import org.springframework.stereotype.*;
import org.springframework.web.bind.annotation.*;

import javax.annotation.*;


@Controller
@RequestMapping
public class ClubController {

    private static final Logger LOGGER = LoggerFactory.getLogger(ClubController.class);

    @Resource
    IClubService clubService;

    @RequestMapping("/club/type/{typeId}")
    @ResponseBody
    public Object getClubsByType(@PathVariable int typeId) {

        LOGGER.debug("【getClubsByType】typeId={}", typeId);

        return clubService.getClubsByType(typeId);
    }

    @RequestMapping("/club/id/{clubId}")
    @ResponseBody
    public Object getClubById(@PathVariable int clubId) {

        LOGGER.debug("【getClubById】clubId={}", clubId);

        return clubService.getClubDetailById(clubId);
    }

    @RequestMapping("/club/name/{likeName}")
    @ResponseBody
    public Object getClubByName(@PathVariable String likeName) {

        LOGGER.debug("【getClubDetailByName】likeName={}", likeName);

        return clubService.getClubDetailByName(likeName);
    }


    @RequestMapping("/club/members/{clubId}")
    @ResponseBody
    public Object getClubMembers(@PathVariable int clubId) {

        LOGGER.debug("【getClubMember】clubId={}", clubId);

        return clubService.getClubMember(clubId);
    }

    @RequestMapping("/club/type2/")
    @ResponseBody
    public Object getClubsByType2(@PathVariable int typeId) {

        LOGGER.debug("【getClubsByType】typeId={}", typeId);

        return clubService.getClubsByType(typeId);
    }


}
